<!-- 头部开始 -->
{% block header %}
<!DOCTYPE html>
<html>

<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>layout 后台大布局 - Layui</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="format-detection" content="telephone=no">

    <link rel="stylesheet" href="/public/layui/css/layui.css" />
    <script src="/public/layui/layui.all.js"></script>
    <script src="https://cdn.bootcss.com/jquery/3.4.1/jquery.js"></script>
</head>
{% endblock %}
<!-- 头部结束 -->

<!-- nav开始 -->
{% block headerNav %}

<body class="layui-layout-body">
    <div class="layui-layout layui-layout-admin">
        <div class="layui-header">
            <div class="layui-logo">layui 后台布局</div>
            <ul class="layui-nav layui-layout-left">
                <li class="layui-nav-item" id="screenshotBtn">
                    截图
                </li>
            </ul>
            <ul class="layui-nav layui-layout-right">
                <li class="layui-nav-item">
                    <a href="javascript:;">
                        贤心
                    </a>
                </li>
            </ul>
        </div>
        <div class="layui-side layui-bg-black">
            <div class="layui-side-scroll">
                <ul class="layui-nav layui-nav-tree" lay-filter="test">
                    <li class="layui-nav-item"><a href="/">领取任务</a></li>
                    <li class="layui-nav-item"><a href="/view/doTask">查看已领取任务</a></li>
                    <li class="layui-nav-item"><a href="/view/getAllDone">已经完任务</a></li>
                </ul>
            </div>
        </div>
        {% endblock %}
        <!-- nav结束 -->

        <div class="layui-body">
            {% block body %}{% endblock %}
        </div>


        <!-- 底部开始 -->
        {% block footer %}
        <div class="layui-footer">
            © layui.com - 底部固定区域
        </div>
    </div>
    {% endblock %}
    <!-- 底部结束 -->

    {% block scriptFooter %}

    {% endblock %}
    <script>
        $("#screenshotBtn").click(() => {
            $.ajax({
                url: "/screenshot",
                type: 'GET',
                dataType: 'json',
                contentType: 'application/json',
                success: function (data, status, xhr) {
                    console.log("截图成功")
                    layer.msg('截图成功');
                },
                error: function (xhr, error, exception) {
                    console.log("截图失败")
                }
            });
        })
    </script>

    <!-- 底部标签闭合 -->
    {% block tabEnd %}
</body>

</html>
{% endblock %}